package pers.rcklos.myserver.entity;

public class CommentItem {
	
	public static final int VISIBLE_SELF_ONLY	 = 0;		// 仅自己可见
	public static final int VISIBLE_BOTH_ONLY	 = 1;		// 双方可见
	public static final int VISIBLE_PUBLIC		 = 2;		// 公共可见
	public static final int VISIBLE_FIREND_ONLY	 = 3;		// 朋友可见
	
	public static final String[] VISBLE_TO_STRINGS = {"自己可见", "双方可见", "公共可见", "朋友可见"};
	
	private long commId;						// 评论id
	private long userId;						// 发送者id
	private long toUser;						// 接受者id
	private long paperId;						// 纸条id
	private long toCommId;						// 回复的评论id
	private String comment;						// 评论内容
	private String addr;						// 地址
	private int visible;						// 可见性
	private long numCommend;					// 点赞数
	private long numComment;					// 评论数
	private java.sql.Date createTime;			// 创建时间
	private java.sql.Date modifyTime;			// 修改时间
	
	
	public CommentItem(long commId, long userId, long toUser, long paperId, long toCommId, String comment, String addr,
			int visible, long numCommend, long numComment, java.sql.Date createTime, java.sql.Date modifyTime) {
		super();
		this.commId = commId;
		this.userId = userId;
		this.toUser = toUser;
		this.paperId = paperId;
		this.toCommId = toCommId;
		this.comment = comment;
		this.addr = addr;
		this.visible = visible;
		this.numCommend = numCommend;
		this.numComment = numComment;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
	}
	
	// bean特有属性
	private String visibleString;
	
	public CommentItem() {
		super();
	}

	public long getCommId() {
		return commId;
	}

	public void setCommId(long commId) {
		this.commId = commId;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public long getToUser() {
		return toUser;
	}

	public void setToUser(long toUser) {
		this.toUser = toUser;
	}

	public long getPaperId() {
		return paperId;
	}

	public void setPaperId(long paperId) {
		this.paperId = paperId;
	}

	public long getToCommId() {
		return toCommId;
	}

	public void setToCommId(long toCommId) {
		this.toCommId = toCommId;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public int getVisible() {
		return visible;
	}

	public void setVisible(int visible) {
		this.visible = visible;
		setVisibleString(VISBLE_TO_STRINGS[visible]);
	}

	public long getNumCommend() {
		return numCommend;
	}

	public void setNumCommend(long numCommend) {
		this.numCommend = numCommend;
	}

	public long getNumComment() {
		return numComment;
	}

	public void setNumComment(long numComment) {
		this.numComment = numComment;
	}

	public java.sql.Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(java.sql.Date createTime) {
		this.createTime = createTime;
	}

	public java.sql.Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(java.sql.Date modifyTime) {
		this.modifyTime = modifyTime;
	}
	
	public String getVisibleString() {
		return visibleString;
	}
	
	public void setVisibleString(String visibleString) {
		this.visibleString = visibleString;
	}

	@Override
	public String toString() {
		return "CommentItem [commId=" + commId + ", userId=" + userId + ", toUser=" + toUser + ", paperId=" + paperId
				+ ", toCommId=" + toCommId + ", comment=" + comment + ", addr=" + addr + ", visible=" + visibleString
				+ ", numCommend=" + numCommend + ", numComment=" + numComment + ", createTime=" + createTime
				+ ", modifyTime=" + modifyTime + "]";
	}
	
}
